package com.yxj04;

import java.io.*;

public class CopyJavaDemo01 {
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("D:\\Ccode\\jdata-structure\\ByteStream9\\src\\com\\yxj04\\ConversionStreamDemo.java"));
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("D:\\Ccode\\jdata-structure\\ByteStream9\\copy.java"));
        //一次读一个字符数据
//        int ch;
//        while((ch = isr.read()) != -1) {
//            osw.write(ch);
//        }

        //一次读一个字符数组数据
        char[] chs = new char[1024];
        int len;
        while((len = isr.read(chs)) != -1) {
            osw.write(chs,0,len);
        }
        osw.close();
        isr.close();

    }
}
